home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Visual Basic Source Code
/
Visual Basic Source Code.iso
/
vbsource
/
encdec
/
encdec.frm
< prev
next >
Wrap
Text File
|
1999-10-06
|
6KB
|
230 lines
VERSION 5.00
Begin VB.Form encdec
Caption = "Developed by Nikki - Encryption/decryption"
ClientHeight = 3195
ClientLeft = 60
ClientTop = 345
ClientWidth = 4980
LinkTopic = "Form1"
ScaleHeight = 3195
ScaleWidth = 4980
StartUpPosition = 3 'Windows Default
Begin VB.CommandButton Command3
Caption = "End"
Height = 825
Left = 2070
Picture = "encdec.frx":0000
Style = 1 'Graphical
TabIndex = 13
Top = 2280
Width = 945
End
Begin VB.CommandButton Command2
Caption = "Decrypt value in Box 3."
Height = 465
Left = 3180
TabIndex = 5
Top = 2520
Width = 1185
End
Begin VB.TextBox decr
Height = 285
Left = 2880
TabIndex = 4
Top = 450
Width = 1605
End
Begin VB.TextBox svd
Height = 465
Left = 1110
TabIndex = 2
Top = 1620
Width = 2535
End
Begin VB.CommandButton Command1
Caption = "Encrypt value in Box 1."
Height = 435
Left = 330
TabIndex = 1
Top = 2550
Width = 1425
End
Begin VB.TextBox pwd
Height = 315
Left = 360
TabIndex = 0
Top = 480
Width = 1665
End
Begin VB.Label Label6
Caption = "3."
BeginProperty Font
Name = "MS Sans Serif"
Size = 8.25
Charset = 0
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 495
Left = 450
TabIndex = 12
Top = 1650
Width = 375
End
Begin VB.Label Label5
Caption = "2."
BeginProperty Font
Name = "MS Sans Serif"
Size = 8.25
Charset = 0
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 405
Left = 2490
TabIndex = 11
Top = 420
Width = 315
End
Begin VB.Label Label4
Caption = "1."
BeginProperty Font
Name = "MS Sans Serif"
Size = 8.25
Charset = 0
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 285
Left = 30
TabIndex = 10
Top = 540
Width = 285
End
Begin VB.Label Label3
Caption = "Decrypting encrypted string"
Height = 645
Left = 3870
TabIndex = 9
Top = 1440
Width = 885
End
Begin VB.Label Label2
Caption = "Value obtained after performing algorithm"
Height = 495
Left = 150
TabIndex = 8
Top = 1140
Width = 1845
End
Begin VB.Line Line3
X1 = 4080
X2 = 4140
Y1 = 1050
Y2 = 1230
End
Begin VB.Line Line2
X1 = 3900
X2 = 4050
Y1 = 1050
Y2 = 1020
End
Begin VB.Line Line1
X1 = 3750
X2 = 4080
Y1 = 1620
Y2 = 990
End
Begin VB.Label b
Height = 285
Left = 3150
TabIndex = 7
Top = 840
Width = 945
End
Begin VB.Label a
Height = 315
Left = 420
TabIndex = 6
Top = 900
Width = 855
End
Begin VB.Label Label1
Caption = "Enter a string to encrypted"
Height = 195
Left = 60
TabIndex = 3
Top = 150
Width = 1935
End
End
Attribute VB_Name = "encdec"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Private Sub Command1_Click()
encrypwd
End Sub
Private Sub encrypwd()
Dim ori As String
Dim plen As Integer
Dim i As Integer
Dim tchg As String
Dim fchg As String
Dim asval As Integer
ori = pwd.Text
plen = Len(ori)
i = 1
fchg = ""
While Not i > plen
tchg = Mid(ori, i, 1)
asval = (Asc(tchg) + 4) * 2 - 4
fchg = fchg + Chr(asval)
i = i + 1
Wend
a.Caption = asval
svd.Text = fchg
End Sub
Private Sub decrypwd()
Dim tchg As String
Dim fchg As String
Dim plen As Integer
Dim i As Integer
Dim asval As Integer
i = 1
plen = Len(svd.Text)
While Not i > plen
tchg = Mid(svd.Text, i, 1)
asval = (Asc(tchg) + 4) / 2 - 4
fchg = fchg + Chr(asval)
i = i + 1
Wend
b.Caption = asval
decr.Text = fchg
End Sub
Private Sub Command2_Click()
decrypwd
End Sub
Private Sub Command3_Click()
End
End Sub